package com.company;

/*
输入3个数,按大小输出这3个数（例如：用户输入的是：10  5  20  ，排序后为：5 10 20）（备注：只能使用三个变量，而且只能使用if的嵌套）
 */
import java.util.Scanner;
public class Compera {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            System.out.print("a=");
            int a = sc.nextInt();
            System.out.print("b=");
            int b = sc.nextInt();
            System.out.print("c=");
            int c = sc.nextInt();
            if (a > b) {                      //a>b的情况 a较大
                if (c > a) {                  //c>a 已知a>b c最大
                    System.out.println(b + "," + a + "," + c);
                } else if (c < b) {  //c<b 已知a>b
                    System.out.println(c + "," + b + "," + a);
                } else {
                    System.out.println(b + "," + c + "," + a);
                }
                // a<b情况
            } else {
                if (c < a) {                  //a<b c<a
                    System.out.println(c + "," + a + "," + b);
                } else if (c > b) {           //a<b c>b
                    System.out.println(a + "," + b + "," + c);
                } else {
                    System.out.println(a + "," + c + "," + b);
                }
            }
        }
    }
